Task difficulty adaptation according to iterative learning controller